<?php

define('SERVER_NAME','http://'.(empty($_SERVER['SERVER_NAME'])?(empty($_SERVER['HTTP_HOST'])?'pdes.tvb.com':$_SERVER['HTTP_HOST']):$_SERVER['SERVER_NAME']).'/');

if(SERVER_NAME == 'http://pdes.tvb.com/'){
	define('AUTH_SERVER','https://auth.tvb.com/');
}else{
	if(preg_match('/(dev|sit|uat)\./',SERVER_NAME,$matched)){
		//define('AUTH_SERVER','https://'.$matched[1].'.auth.tvb.com/');
		define('AUTH_SERVER','https://sit.auth.tvb.com/');
	}else{
		define('AUTH_SERVER','https://auth.tvb.com/');
	}
}

class AppConfiguration{
	const CONFIG_FILE = '/data/pms/pdes/conf/config.xml';
	const CONFIG_FOLDER_FILE = '/data/pms/pdes/conf/folder.xml';
	const CONFIG_ALLOW_TAG = '/data/pms/pdes/conf/allow_tag.xml';
	const CONFIG_HIIGHLIGHT_ROLE = '/data/pms/pdes/conf/highlight_roles.xml';
	const CONFIG_MQ = '/data/pms/pdes/conf/consumer.xml';

	#const PDES_BASE_URL = 'http://pdes.tvb.com/';
	const PDES_BASE_URL = SERVER_NAME;
	const AUTH_BASE_URL = AUTH_SERVER;
    const PDES_FLASH_ASSETS_PROCESS = 'http://pdes.tvb.com/swf/src/assets/process.png';
    const PDES_FLASH_ASSETS_WAIT    = 'http://pdes.tvb.com/swf/src/assets/waiting.png';
    const PDES_FLASH_ASSETS_FAILURE = 'http://pdes.tvb.com/swf/src/assets/failure.png';

// mongodb server for change_log


	//catchup Video 
	const VIDEO_CATCHUP = 20;
	//auto publish
	const AUTO_PUBLISH_MINUTE = 15;

    //Video Max SEO tag
    const SEO_MAX_TAG = 15;
	//product name
	const PRODUCT_NAME = 'PDES';
	const ERROR_CODE_SUFFIX = 'e';

	//default language
	const DEFAULT_LANGUAGE = 'zh-Hant-HK';
	const LANGUAGE_ZH = 'zh-Hant-HK';
	const LANGUAGE_EN = 'en-HK';

	//role type
	const ROLE_TYPE_CAST = 1;
	const ROLE_TYPE_CREW = 2;

	//folder type
	const FOLDER_TYPE_VIDEO = 1;
	const FOLDER_TYPE_IMAGE = 2;

	//company code default
	const DEFAULT_COMPANY_CODE = 'TVB';

	//status
	const STATUS_NEW = 1;
	const STATUS_DELETED = 2;
	const STATUS_PUBLISH = 3; // non-premium
	const STATUS_UNPUBLISH = 4; // non-premium
	const STATUS_LOG_SUCCESS = 5;
	const STATUS_LOG_FAILED  = 6;
    const STATUS_HIBERNATE   = 7;
    const STATUS_PUBLISH_PREMIUM = 8;
	const STATUS_UNPUBLISH_PREMIUM = 9;
	const STATUS_PROCESSING = 10;
	const STATUS_PROCESSING_PREMIUM = 11;
	const STATUS_LOG_FAILED_PREMIUM = 12;

	public static $op_status = array(
		self::STATUS_NEW=> "Active",
		self::STATUS_DELETED=>"Deleted",
		self::STATUS_PUBLISH=>"Published",
		self::STATUS_UNPUBLISH=>"Unpublished",
		self::STATUS_LOG_SUCCESS=>"Success",
		self::STATUS_LOG_FAILED=>"Failed",
		self::STATUS_HIBERNATE=>"Hibernate",
        self::STATUS_PUBLISH_PREMIUM => 'Published (Premium)',
        self::STATUS_UNPUBLISH_PREMIUM => 'Unpublished (Premium)',
		self::STATUS_PROCESSING => 'Processing',
		self::STATUS_PROCESSING_PREMIUM => 'Processing (Premium)',
		self::STATUS_LOG_FAILED_PREMIUM => 'Failed (Premium)',
	);
    public static $op_status2id =   array(
        "active"        =>  self::STATUS_NEW,
        "deleted"       =>  self::STATUS_DELETED,
        "published"     =>  self::STATUS_PUBLISH,
        "unpublished"   =>  self::STATUS_UNPUBLISH,
        "success"       =>  self::STATUS_LOG_SUCCESS,
        "failed"        =>  self::STATUS_LOG_FAILED,
		"processing"    =>  self::STATUS_PROCESSING,
		"processing"    =>  self::STATUS_PROCESSING_PREMIUM,
		"failed"        =>  self::STATUS_LOG_FAILED_PREMIUM,
    );

	//log 
	const LOG_OP_CREATE  = 1;
	const LOG_OP_DELETE  = 2;
	const LOG_OP_UPDATE  = 3;
	const LOG_OP_PUBLISH = 4;
	const LOG_OP_UNPUBLISH = 5;
	const LOG_OP_RECOVER   = 6;
	const LOG_OP_PUBLISHING = 7;
	const LOG_OP_UNPUBLISHING = 8;
	const LOG_OP_PUBLISH_FAILED = 9;
	const LOG_OP_UNPUBLISH_FAILED = 10;
	const LOG_OP_PREMIUM_PUBLISH = 11;
    const LOG_OP_PREMIUM_UNPUBLISH = 12;
    const LOG_OP_PREMIUM_PUBLISHING = 13;
	const LOG_OP_PREMIUM_UNPUBLISHING = 14;
	const LOG_OP_PREMIUM_PUBLISH_FAILED = 15;
	const LOG_OP_PREMIUM_UNPUBLISH_FAILED = 16;
	public static $log_type = array(
		self::LOG_OP_CREATE =>"Create",
		self::LOG_OP_DELETE =>"Delete",
		self::LOG_OP_UPDATE =>"Update",
		self::LOG_OP_PUBLISH =>"Proof-read",
		self::LOG_OP_UNPUBLISH =>"Unpublish",
		self::LOG_OP_RECOVER=>"Recover",
		self::LOG_OP_UNPUBLISHING =>"Unpublishing",
		self::LOG_OP_PUBLISHING=>"Proofreading",
		self::LOG_OP_PUBLISH_FAILED=>"Proofread-failed",
		self::LOG_OP_UNPUBLISH_FAILED=>"Unpublish-failed",
		self::LOG_OP_PREMIUM_PUBLISH =>"Proof-read<br />(Premium)",
		self::LOG_OP_PREMIUM_UNPUBLISH =>"Unpublish<br />(Premium)",
        self::LOG_OP_PREMIUM_UNPUBLISHING =>"Unpublishing<br />(Premium)",
        self::LOG_OP_PREMIUM_PUBLISHING =>"Proofreading<br />(Premium)",
		self::LOG_OP_PREMIUM_PUBLISH_FAILED =>"Proofread-failed<br />(Premium)",
		self::LOG_OP_PREMIUM_UNPUBLISH_FAILED =>"Unpublish-failed<br />(Premium)",
	);
    public static $publicLogAction = array(
		self::LOG_OP_PUBLISH =>"Published",
		self::LOG_OP_UNPUBLISH =>"Unpublished",
        self::LOG_OP_PREMIUM_PUBLISH => 'Published (Premium)',
        self::LOG_OP_PREMIUM_UNPUBLISH => 'Unpublished (Premium)',
    );

	const VI_DESTINATION_ID = 1;
	const II_DESTINATION_ID = 1;

	const VIDEO_STATUS_QUEUE    = 3; // waiting back cronjob send video to VI server
	const VIDEO_STATUS_WAITING  = 2; // waiting VI server callback
	const VIDEO_STATUS_UPLOADED = 1;
	const VIDEO_STATUS_FAILED   = -1;

	public static $video_status_label = array(
	    self::VIDEO_STATUS_QUEUE    => 'queue', 
	    self::VIDEO_STATUS_WAITING  => 'waiting', 
	    self::VIDEO_STATUS_UPLOADED => 'uploaded',
	    self::VIDEO_STATUS_FAILED   => 'failed',
	);

    public static $video_status_ui = array(
	    self::VIDEO_STATUS_QUEUE    => 'Processing', 
	    self::VIDEO_STATUS_WAITING  => 'Waiting', 
	    self::VIDEO_STATUS_UPLOADED => 'Ready',
	    self::VIDEO_STATUS_FAILED   => 'Failed'
    );

    public static $p_infoType =   array(
        'address'       =>  'p_info_address',
        'award'         =>  'p_info_award',
        'biography'     =>  'p_info_biography',
        'general_info'  =>  'p_info_general_information',
        'pageant'		=> 	'p_info_pageant',
        'product'       =>  'p_info_product',
        'qa'            =>  'p_info_q_a',
        'recipe'        =>  'p_info_recipe',
        'song'          =>  'p_info_song',
    );

    # info db name => info type!
    public static $p_name2Type=   array(
        'p_info_address'              =>  'address',
        'p_info_award'                =>  'award',
        'p_info_biography'            =>  'biography',
        'p_info_general_information'  =>  'general_info',
        'p_info_pageant'		      => 	'pageant',
        'p_info_product'              =>  'product',
        'p_info_q_a'                  =>  'qa',
        'p_info_recipe'               =>  'recipe',
        'p_info_song'                 =>  'song',
    );
    # info db name => info type!
    public static $p_table2Name=  array(
        'p_info_address'              =>  'Address',
        'p_info_award'                =>  'Award',
        'p_info_biography'            =>  'Biography',
        'p_info_general_information'  =>  'General Information',
        'p_info_pageant'		      => 	'Pageant',
        'p_info_product'              =>  'Product',
        'p_info_q_a'                  =>  'Q&A',
        'p_info_recipe'               =>  'Recipe',
        'p_info_song'                 =>  'Song',
    );

    # info type =>  info db name!
    public static $infoType =   array(
		'address'       =>  'info_address',
		'award'         =>  'info_award',
		'biography'     =>  'info_biography',
		'general_info'  =>  'info_general_information',
		'pageant'		=> 	'info_pageant',
		'product'       =>  'info_product',
		'qa'            =>  'info_q_a',
		'recipe'        =>  'info_recipe',
		'song'          =>  'info_song',
	);

    # info db name => info type!
    public static $name2Type=   array(
        'info_address'              =>  'address',
        'info_award'                =>  'award',
        'info_biography'            =>  'biography',
        'info_general_information'  =>  'general_info',
        'info_pageant'		        => 	'pageant',
        'info_product'              =>  'product',
        'info_q_a'                  =>  'qa',
        'info_recipe'               =>  'recipe',
        'info_song'                 =>  'song',
    );
    # info db name => info type!
    public static $table2Name=  array(
        'info_address'              =>  'Address',
        'info_award'                =>  'Award',
        'info_biography'            =>  'Biography',
        'info_general_information'  =>  'General Information',
        'info_pageant'		        => 	'Pageant',
        'info_product'              =>  'Product',
        'info_q_a'                  =>  'Q&A',
        'info_recipe'               =>  'Recipe',
        'info_song'                 =>  'Song',
    );

    public static $infoName = array(
        'address'   =>  array('label'=>'Address', 'name_field'=>array('venue_name_chinese','venue_name_english')),
        'award'     =>  array('label'=>'Award', 'name_field'=>array('award_title_chinese','award_title_english')),
        'biography' =>  array('label'=>'Biography', 'name_field'=>array('name_chinese','name_english')),
        'general_info'   =>  array('label'=>'General Info', 'name_field'=>array('title_chinese','title_english')),
        'pageant' =>  array('label'=>'Pageant', 'name_field'=>array('name_chinese','name_english')),
        'product'   =>  array('label'=>'Product', 'name_field'=>array('product_name_chinese','product_name_english')),
        'qa'        =>  array('label'=>'Q&A', 'name_field'=>array('question')),
        'recipe'    =>  array('label'=>'Recipe', 'name_field'=>array('dish_name_chinese','dish_name_english')),
        'song'      =>  array('label'=>'Song', 'name_field'=>array('title_chinese','title_english')),
    );
	public static $infoAction = array(
		'address'       =>  'InfoAddressAddAction',
		'award'         =>  'InfoAwardAddAction',
		'biography'     =>  'InfoBiographyAddAction',
		'general_info'  =>  'InfoGeneralAddAction',
		'pageant'		=>  'InfoPageantAddAction',
		'product'       =>  'InfoProductAddAction',
		'qa'            =>  'InfoQnaAddAction',
		'recipe'        =>  'InfoRecipeAddAction',
		'song'          =>  'InfoSongAddAction'
    );
    
    public static $p_infoJson  = array(
        'p_info_address'       => array('contact_person'),
        'p_info_award'         =>  array('winners', 'award_presenters','nominees','organizations'),
        'p_info_biography'     =>  array(),
        'p_info_general_information'  =>  array(),
        'p_info_pageant'       =>  array(),
        'p_info_product'       =>  array(),
        'p_info_q_a'           =>  array(),
        'p_info_recipe'        =>  array('designed_by','presented_by'),
        'p_info_song'          =>  array('singers','group_names','producers','composers','lyricists','arrangers','owners'),
        'p_cast'               =>  array(),
        'p_chapter'            =>  array()
    );

    public static $infoJson  = array(
        'info_address'       => array('contact_person'),
        'info_award'         =>  array('winners', 'award_presenters','nominees','organizations'),
        'info_biography'     =>  array(),
        'info_general_information'  =>  array(),
        'info_pageant'       =>  array(),
        'info_product'       =>  array(),
        'info_q_a'           =>  array(),
        'info_recipe'        =>  array('designed_by','presented_by'),
        'info_song'          =>  array('singers','group_names','producers','composers','lyricists','arrangers','owners'),
        'cast'               =>  array(),
        'chapter'            =>  array()
    );

    //folder status
    public static $folder_status = array(
        '0'=>'',
        '1'=>'Updated',
        '2'=>'Updated',
        '3'=>'Removed'
    );
    const VIDEO_UPLOAD_TYPES   = '.mp4';//,.flv,.f4v,.avi';
    const VIDEO_STORE_PATH     = '/data/pms/pdes/video/upload/';

    const VIDEO_CALLBACK_API   = 'http://pdes.tvb.com/services/set_video_status.php';
    //const MIS_API              = 'http://mis.tvb.com/load.php';
    //const MIS_API              = 'http://172.30.208.226/tvb_com/getData.aspx';
	// remember map host  : 172.16.66.24   pdes-mis.tvb.com
    const MIS_API              = 'http://mis-pdes.tvb.com/tvb_com/getData.aspx';
	public static $mis_view_url = 'http://pdes.tvb.com/pms_detail.html?type=mis&act=view&pdes_type=%s&id=%d';

    // VI API Parameters
    // Using:
    //		$vi_params = AC::$vi_export_params['500kb'];
    //		$vi_params['callback_url'] = CommonUtils::url_add_param($vi_params['callback_url'],array('video_id'=>$vo_id));
    //
    //		$vi_params = array_values($vi_params);
	//		array_unshift($vi_params, $user_id, $source_id);
	//
	//		$export_id = call_user_func_array(array($vi,'requestExport'),$vi_params);
	public static $vi_export_params = array( // Parameters order by VI::requestExport function parameters
		
		'mp4_900k' => array(
			'video_width'              => 852,
			'video_height'             => 480,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 804000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 96000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'               => '',
			'callback_url'             => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 1,
		),
		'mp4_hq' => array(
			'video_width'              => 1280,
			'video_height'             => 720,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 1404000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 96000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'               => '',
			'callback_url'             => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 1,
		),
		'mp4_4/3:hq' => array(
			'video_width'              => 540,
			'video_height'             => 406,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 1452000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 48000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'               => '',
			'callback_url'             => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 1,
		),		
		'mp4_mq' => array(
			'video_width'              => 640,
			'video_height'             => 360,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 452000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 48000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'               => '',
			'callback_url'             => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 1,
		),
		'mp4_4/3:mq' => array(
			'video_width'              => 540,
			'video_height'             => 406,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 450000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 48000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'               => '',
			'callback_url'             => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 1,
		),		
		'mp4_lq'=>array(
			'video_width'              => 640,
			'video_height'             => 360,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 152000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 48000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'			   => '',
			'callback_url'             => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 1,
		),
		'mp4_4/3:lq'=>array(
			'video_width'              => 240,
			'video_height'             => 180,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 152000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 48000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'			   => '',
			'callback_url'             => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 1,
		),		
		'3gp_mq'=>array(
			'video_width'              => 320,
			'video_height'             => 180,
			'video_codec'              => 'MPEG-4',
			'video_bitrate'            => 220000,
			'video_frame_rate'         => 15,
			'video_pixel_aspect_ratio' => 0,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 20000,
			'video_audio_channel'      => 1,
			'video_audio_sample_rate'  => 22050,
			'export_arg'			   => '',
			'callback_url'			   => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 3,
		),
		'3gp_4/3:mq' => array(
			'video_width'              => 320,
			'video_height'             => 240,
			'video_codec'              => 'MPEG-4',
			'video_bitrate'            => 220000,
			'video_frame_rate'         => 15,
			'video_pixel_aspect_ratio' => 0,
  			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 20000,
			'video_audio_channel'      => 1,
			'video_audio_sample_rate'  => 22050,
			'export_arg'			   => '',
			'callback_url'			   => 'http://pdes.tvb.com/services/set_video_status.php',
			'format_id'				   => 3,
		),
                'iphone_lq'=>array(
                        'video_width'              => 400,
                        'video_height'             => 224,
                        'video_codec'              => 'AVC',
                        'video_bitrate'            => 110000,
                        'video_frame_rate'         => 30,
                        'video_pixel_aspect_ratio' => 1,
                        'video_audio_codec'        => 'AAC',
                        'video_audio_bitrate'      => 40000,
                        'video_audio_channel'      => 1,
                        'video_audio_sample_rate'  => 22050,
                        'export_arg'                       => '',
                        'callback_url'                     => '',
                        'format_id'                                => 5,
                ),
		'iphone_mp4_mq'=>array(
			'video_width'              => 512,
			'video_height'             => 288,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 176000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 24000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'			   => '',
			'callback_url'			   => '',
			'format_id'				   => 2,
		),
		'iphone_mp4_4/3:mq' => array(
			'video_width'              => 540,
			'video_height'             => 406,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 652000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
  			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 48000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'			   => '',
			'callback_url'			   => '',
			'format_id'				   => 2,
		),
		'iphone_mp4_lq'=>array(
			'video_width'              => 512,
			'video_height'             => 288,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 176000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 24000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'			   => '',
			'callback_url'			   => '',
			'format_id'				   => 2,
		),
		'iphone_mp4_4/3:lq' => array(
			'video_width'              => 540,
			'video_height'             => 406,
			'video_codec'              => 'AVC',
			'video_bitrate'            => 652000,
			'video_frame_rate'         => 25,
			'video_pixel_aspect_ratio' => 1,
  			'video_audio_codec'        => 'AAC',
			'video_audio_bitrate'      => 48000,
			'video_audio_channel'      => 2,
			'video_audio_sample_rate'  => 44100,
			'export_arg'			   => '',
			'callback_url'			   => '',
			'format_id'				   => 2,
		),
	);

	const IMAGE_STATUS_WAITING  = 2; // Uploading : waiting VI server callback
	const IMAGE_STATUS_UPLOADED = 1;
	const IMAGE_STATUS_FAILED   = -1;
	public static $image_status_label = array(
	    self::IMAGE_STATUS_WAITING  => 'wating', 
	    self::IMAGE_STATUS_UPLOADED => 'uploaded',
	    self::IMAGE_STATUS_FAILED   => 'failed',
	);

    public static $mdes_status = array(
        '1' => 'Active',
        '2' => 'Inactive',
        '3' => 'Pending To Delete',
        '4' => 'Restricted'
    );

	//VI API Parameters
	const IMAGE_RESIZE_MODE    = 1; //0=STRETCH:直接調用$imagick->resizeImage();  1=PAD:用黑色背景填充縮圖空白;   2=CROP:直接調用$imagick->cropThumbnailImage();   3=PASSTHROUGH:不知道
	const IMAGE_RESIZE_TIMEOUT = 2; 
	const IMAGE_EXPORT_FORMAT  = 2; //2:is JPG file
	const IMAGE_CALLBACK_API   = 'http://pdes.tvb.com/services/set_image_status.php';

	const MAM_API_URL = "http://202.126.52.4/tvb_com/getData.aspx?";
	public static $mam_filter  = array("FUNCT_CODE","CO_CODE","PGM_NUM","START_SEQ","NUM_OF_PROG","EPI_NUM","ITEM_NUM");

	const AJAX_API_URL = "services/get_list.php";
	const AJAX_TAG_API_URL = "services/get_tag.php";
    const AJAX_CAST_API_URL = 'services/get_cast.php';

	# For Portal Service
    const PORTAL_CONFIG_FILE = '/data/pms/pdes/conf/portal.xml';
    const OCTO_SHAPE_WS_SERVICE = 'http://vi.api.tvb.com/getoctoshapestatus.php';

    const LUCENE_OPERATION_ADD = 'add';
    const LUCENE_OPERATION_EDIT = 'edit';
    const LUCENE_OPERATION_DEL = 'del';

    public static $info_type_id = array(
        'info_address' => 1,
        'info_award' => 2,
        'info_biography' => 3,
        'info_general_information' => 4,
        'info_product' => 5,
        'info_q_a' => 6,
        'info_recipe' => 7,
        'info_song' => 8,
        'info_pageant' => 9,
    );

	const DEFAULT_COUNTRY_ALLOW_LIST = 'HK,ID,VN,TH,PH,TW,IN,AU,JP,KR,RU,GB,MO';
	const DEFAULT_COUNTRY_DENY_LIST = 'ALL';
    const COUNTRY_LIST_CODE = '/data/pms/pdes/conf/countryCode.xml'; 
    public static $country_service = 'services/get_country.php';
    public static $country_stat = array(
        'Africa'=> 'Africa',
        'Asia'=> 'Asia',
        'Europe'=> 'Europe',
        'North America'=> 'North America',
        'South America'=> 'South America',
        'Oceania'=> 'Oceania',
        'Others'=> 'Others',
    );

    const WAITING_VIDEO_LOG = '/opt/pdes/bin/waiting_videos';

}

// AC is an alias of AppConfiguration
final class AC extends AppConfiguration{}
?>
